package com.sumainfor.pc.epc.controller;

import com.sumainfor.common.util.JsonResult;
import com.sumainfor.common.utlis.Pager;
import com.sumainfor.pc.epc.service.DecoratedBeingService;
import com.sumainfor.pc.epc.service.DecorateplanService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@Controller
@RequestMapping("/key/DecoratKeyController")
public class DecoratKeyController {


    @Autowired
    DecoratedBeingService decoratedBeingService;

    @Autowired
    DecorateplanService decorateplanService;
    /**
     * 按条件查询验房列表
     * @param params
     * @return
     */
    @ResponseBody
    @RequestMapping("getplan_info_building")
    public JsonResult getplan_info_building(@RequestParam Map<String,Object> params, Pager pager){
        return  decoratedBeingService.getplan_info_building(params,pager);
    }

    /**
     * 管家验房
     * @param params
     * @return
     */
    @ResponseBody
    @RequestMapping("updateInspectStateBy")
    public JsonResult updateInspectStateBy(@RequestParam Map<String,Object> params){
        return  decoratedBeingService.updateInspectStateBy(params);
    }


    /**
     * 管家验房
     * @param params
     * @return
     */
    @ResponseBody
    @RequestMapping("updateIfUpload")
    public JsonResult updateIfUpload(@RequestParam Map<String,Object> params){
        return  decorateplanService.updateIfUpload(params);
    }

    /**
     * 查询报修物品清单分类
     * @param params
     * @return
     */
    @ResponseBody
    @RequestMapping("getArticleType")
    public JsonResult getArticleType(@RequestParam Map<String,Object> params){
        return  decoratedBeingService.getArticleType(params);
    }

    /**
     * 根据武平清单分类id 查询报修物品清单
     * @param params
     * @return
     */
    @ResponseBody
    @RequestMapping("getarticle")
    public JsonResult getarticle(@RequestParam Map<String,Object> params){
        return  decoratedBeingService.getarticle(params);
    }

    /**
     * 根据报修物品清单id 查询故障描述
     * @param params
     * @return
     */
    @ResponseBody
    @RequestMapping("getArticleTrouble")
    public JsonResult getArticleTrouble(@RequestParam Map<String,Object> params){
        return  decoratedBeingService.getArticleTrouble(params);
    }

    /**
     * 根据报修物品清单id 查询故障描述
     * @param params
     * @return
     */
    @ResponseBody
    @PostMapping("saveTepair")
    public JsonResult saveTepair(@RequestBody Map<String,Object> params){


        return  decoratedBeingService.saveTepair(params);
    }

}
